<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/css/style.css" />
    <!--[if IE 6]>
    <script src="__PUBLIC__/js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
    
    <script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/menu.js"></script>    
                
	<script type="text/javascript" src="__PUBLIC__/js/n_nav.js"></script>   
    
    <script type="text/javascript" src="__PUBLIC__/js/select.js"></script>
    
    <script type="text/javascript" src="__PUBLIC__/js/num.js">
    	var jq = jQuery.noConflict();
    </script>     
    
    <script type="text/javascript" src="__PUBLIC__/js/shade.js"></script>
    
<title>数码商城</title>
</head>
<body>  
<!--Begin Header Begin-->
<include file="./Public/page/header.html" />
<!--End Header End--> 
<!--Begin Menu Begin-->
<div class="menu_bg">
	<div class="menu">
    	<!--Begin 商品分类详情 Begin-->    
    	<div class="nav">
        	<div class="nav_t">全部商品分类</div>
            <div class="leftNav none">
                <ul>      
                    <volist name="t_list" id="t_list">  
                    <li>
                        <div class="fj">
                            <span class="n_img"><span></span><img src="__PUBLIC__/images/nav1.png" /></span>
                            <span class="fl">{$t_list.name}</span>
                        </div> 
                        <notempty name="t_list['lower']">
                       
                        <div class="zj">
                            <div class="zj_l">
                             <volist name="t_list[lower]" id="w_list">
                                <div class="zj_l_c">
                                    <h2><a href="{:U('Home/List/index',['id'=>$w_list['id']])}">{$w_list['name']}</a></h2>
                                    <notempty name="w_list['lower']">
                                    <volist name="w_list['lower']" id="e_list">
                                    <a href="{:U('Home/List/index',['id'=>$e_list['id']])}">{$e_list['name']}</a>|
                                    </volist>
                                    </notempty>
                                </div>
                            </volist>
                            </div>
                        
                        </div>
                        
                        </notempty>
                    </li>
                    </volist>	
                </ul>            
            </div>
        </div>  
        <!--End 商品分类详情 End-->                                                     
    	<ul class="menu_r">
		<!--导航-->
		<include file="./Public/page/danhanglan.html" />
        </ul>
       
    </div>
</div>
<!--End Menu End--> 
<div class="i_bg">  
    <div class="content mar_20">
    	<img src="__PUBLIC__/images/img2.jpg" />        
    </div>
    
    <!--Begin 第二步：确认订单信息 Begin -->
    <div class="content mar_20">
    	<div class="two_bg">
        	<div class="two_t">
            <!-- <a href="{:U('Home/Buycar/index')}">修改</a> -->
            	<span class="fr"></span>商品列表
            </div>
            <table border="0" class="car_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
              <tr>
                <td class="car_th" width="550">商品名称</td>
                <td class="car_th" width="140">属性</td>
                <td class="car_th" width="150">购买数量</td>
                <td class="car_th" width="150">积分</td>
                <td class="car_th" width="130">小计</td>
                <!-- <td class="car_th" width="140">返还积分</td> -->
              </tr>

              <foreach name="list" item="val">
              <tr class="car_tr">
                <td>
                    <div class="c_s_img"><img src="/TP/Uploads/comm/{$val.goodspic}" width="73" height="73" /></div>
                    {$val.goodsname}
                </td>
                <td align="center">颜色：{$val.color}<br></td>
                <td align="center">{$val.number}</td>
                <td align="center">{$val.integral}</td>
                <td align="center" style="color:#ff4e00;">￥{$val.total}</td>
               <!--  <td align="center">26R</td> -->
              </tr>
              </foreach> 
              <tr>
                <td colspan="5" align="right" style="font-family:'Microsoft YaHei';">
                    商品总价：￥{$total} 
                </td>
              </tr>
            </table>
            
            <div class="two_t">
            	<span class="fr"></span>收货人信息
            </div>
            <!-- 表单 -->
            <form action="{:U('Home/Orders/flash')}" method="post">
            <table border="0" class="peo_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
            <tr>
                <th>收货人</th>
                <th>手机号码</th>
                <th>详细地址</th>
                <th>邮政编码</th>
                <th>选中</th>
                <th>编辑</th>
            </tr>
            <empty name="address">
                 <tr> 
                <!-- <td class="p_td" width="160">收货人</td> -->
                <td width="200"><input type="text" style="width:100px" id="linkman" name="linkman" value="" /></td>
                <!-- <td class="p_td" width="160">手机号码</td> -->
                <td width="200"><input type="text" style="width:100px" id="phone" name="phone" value="" /></td>
                <!-- <td class="p_td" width="160">详细地址</td> -->
                <td width="200"><textarea type="text" clos="2" rows="2" id="address" name="address" value=""></textarea></td>
                <!-- <td class="p_td" width="160">邮政编码</td> -->
                <td width="150"><input type="text" style="width:100px" id="code" name="code" value="" /></td>
                <td><input type="radio" value="" name="id"/></td>
                <td><i onclick="add_address()">保存</i></td>
                <!-- <input type="radio" />adfad -->
              </tr>
            
            <else />
            <foreach name="address" item="address">
              <tr> 
                <!-- <td class="p_td" width="160">收货人</td> -->
                <td width="200"><input type="text" style="width:100px" id="linkman{$address.id}" name="linkman" value="{$address.linkman}" /></td>
                <!-- <td class="p_td" width="160">手机号码</td> -->
                <td width="200"><input type="text" style="width:100px" id="phone{$address.id}" name="phone" value="{$address.phone}" /></td>
                <!-- <td class="p_td" width="160">详细地址</td> -->
                <td width="200"><textarea type="text" clos="2" rows="2" id="address{$address.id}" name="address" value="">{$address.address}</textarea></td>
                <!-- <td class="p_td" width="160">邮政编码</td> -->
                <td width="150"><input type="text" style="width:100px" id="code{$address.id}" name="code" value="{$address.code}" /></td>
                <td><input type="radio" {$address['status']==1?checked:""} value="{$address.id}" name="id"/></td>
                <td><i onclick="up_address({$address.id})">保存修改</i></td>
                <!-- <input type="radio" />adfad -->
              </tr>
              </foreach>
              </empty>
            </table>
            <table border="0" style="width:900px; margin-top:20px;" cellspacing="0" cellpadding="0">
              <tr>
                <td align="right">
                	该订单完成后，您将获得 <font color="#ff4e00">{$integral}</font>的积分
                    商品总价: <font color="#ff4e00">￥{$total}</font> 
                </td>
              </tr>
              <tr height="70">
                <td align="right">
                	<b style="font-size:14px;">应付款金额：<span style="font-size:22px; color:#ff4e00;">￥{$total}</span></b>
                </td>
              </tr>
              <tr height="70">
                <!-- <td align="right"><a href="#"><img src="__PUBLIC__/images/btn_sure.gif" /></a></td> -->
                <td align="right"><input type="submit" value=""style="background-image:url(__PUBLIC__/images/btn_sure.gif);width:180px;height:45px;border:none"/></td>      
              </tr>
            </table>
            </form>

            
        	
        </div>
    </div>
	<!--End 第二步：确认订单信息 End-->
    
    
    <!--Begin Footer Begin -->
    <include file="./Public/page/footer.html" />
    <!--End Footer End -->    
</div>
<script>
    //修改方法
    function up_address(id)
    {
        // alert(id);
        var l = "#linkman"+id;
        var p = "#phone"+id;
        var a = "#address"+id;
        var c = "#code"+id;
        //获取要修改的值
        var linkman = jq(l).val();
        var phone = jq(p).val();
        var address = jq(a).val();
        var code = jq(c).val();
        jq.get("{:U('Home/orders/up_address')}",{
            'linkman':linkman,
            'phone':phone,
            'address':address,
            'code':code,
            'id':id
        },function(data){
            alert(data);
        });
    }

    //添加新地址
    function add_address(){
        var linkman = jq('#linkman').val();
        var phone = jq('#phone').val();
        var address = jq('#address').val();
        var code = jq('#code').val();
        jq.get("{:U('Home/orders/add_address')}",{
            'linkman':linkman,
            'phone':phone,
            'address':address,
            'code':code,
        },function(data){
            if(data == '保存成功'){
                window.location.reload();
            }
        });
    }
</script>
</body>


<!--[if IE 6]>
<script src="__PUBLIC__///letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
